﻿Imports CupsApp.Service

Partial Public Class ChangePassword
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btnChangePassword_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnChangePassword.Click
        Dim context As New HttpContextWrapper(HttpContext.Current)
        Dim service As CupsDomainService = DomainServicesFactory.CreateDomainService(context)

        If (service.ChangePassword(HttpContext.Current.User.Identity.Name, txtCurrentPassword.Text, txtPassword.Text)) Then
            lblStatus.Text = "Password successfully changed."
        Else
            lblStatus.Text = "Password change failed"
        End If
    End Sub
End Class